#include	"compiler.h"
#include	"midiout.h"


const SINT32 freq_table[128] = {
			    8175,     8661,     9177,     9722,    10300,    10913,
			   11562,    12249,    12978,    13750,    14567,    15433,

			   16351,    17323,    18354,    19445,    20601,    21826,
			   23124,    24499,    25956,    27500,    29135,    30867,

			   32703,    34647,    36708,    38890,    41203,    43653,
			   46249,    48999,    51913,    55000,    58270,    61735,

			   65406,    69295,    73416,    77781,    82406,    87307,
			   92498,    97998,   103826,   110000,   116540,   123470,

			  130812,   138591,   146832,   155563,   164813,   174614,
			  184997,   195997,   207652,   220000,   233081,   246941,

			  261625,   277182,   293664,   311126,   329627,   349228,
			  369994,   391995,   415304,   440000,   466163,   493883,

			  523251,   554365,   587329,   622253,   659255,   698456,
			  739988,   783990,   830609,   880000,   932327,   987766,

			 1046502,  1108730,  1174659,  1244507,  1318510,  1396912,
			 1479977,  1567981,  1661218,  1760000,  1864655,  1975533,

			 2093004,  2217461,  2349318,  2489015,  2637020,  2793825,
			 2959955,  3135963,  3322437,  3520000,  3729310,  3951066,

			 4186009,  4434922,  4698636,  4978031,  5274040,  5587651,
			 5919910,  6271926,  6644875,  7040000,  7458620,  7902132,

			 8372018,  8869844,  9397272,  9956063, 10548081, 11175303,
			11839821, 12543853};

const SINT16 envsin12q[1 << (SINENT_BIT - 2)] = {
			   0,   50,  100,  150,  200,  251,  301,  351,
			 401,  451,  501,  551,  601,  650,  700,  749,
			 799,  848,  897,  946,  995, 1043, 1092, 1140,
			1189, 1237, 1284, 1332, 1379, 1427, 1474, 1520,
			1567, 1613, 1659, 1705, 1751, 1796, 1841, 1886,
			1930, 1975, 2018, 2062, 2105, 2148, 2191, 2233,
			2275, 2317, 2358, 2399, 2439, 2480, 2519, 2559,
			2598, 2637, 2675, 2713, 2750, 2787, 2824, 2860,
			2896, 2931, 2966, 3000, 3034, 3068, 3101, 3134,
			3166, 3197, 3229, 3259, 3289, 3319, 3348, 3377,
			3405, 3433, 3460, 3487, 3513, 3538, 3563, 3588,
			3612, 3635, 3658, 3680, 3702, 3723, 3744, 3764,
			3784, 3803, 3821, 3839, 3856, 3873, 3889, 3904,
			3919, 3933, 3947, 3960, 3973, 3985, 3996, 4007,
			4017, 4026, 4035, 4043, 4051, 4058, 4065, 4071,
			4076, 4080, 4084, 4088, 4091, 4093, 4094, 4095};

const SINT16 vibsin12[1 << VIBRATE_SHIFT] = {
			    0,   401,   799,  1189,  1567,  1930,  2275,  2598,
			 2896,  3166,  3405,  3612,  3784,  3919,  4017,  4076,
			 4096,  4076,  4017,  3919,  3784,  3612,  3405,  3166,
			 2896,  2598,  2275,  1930,  1567,  1189,   799,   401,
			    0,  -401,  -799, -1189, -1567, -1930, -2275, -2598,
			-2896, -3166, -3405, -3612, -3784, -3919, -4017, -4076,
			-4096, -4076, -4017, -3919, -3784, -3612, -3405, -3166,
			-2896, -2598, -2275, -1930, -1567, -1189,  -799,  -401};

const SINT16 voltbl12[128] = {
			 256,  261,  267,  273,  279,  285,  291,  298,
			 304,  311,  318,  325,  332,  340,  347,  355,
			 363,  371,  379,  387,  396,  404,  413,  422,
			 432,  441,  451,  461,  471,  482,  492,  503,
			 514,  526,  537,  549,  561,  574,  586,  599,
			 613,  626,  640,  654,  668,  683,  698,  714,
			 730,  746,  762,  779,  796,  814,  832,  850,
			 869,  888,  908,  928,  948,  969,  991, 1012,
			1035, 1058, 1081, 1105, 1129, 1154, 1180, 1206,
			1232, 1260, 1287, 1316, 1345, 1374, 1405, 1436,
			1468, 1500, 1533, 1567, 1602, 1637, 1673, 1710,
			1748, 1786, 1826, 1866, 1907, 1949, 1992, 2036,
			2081, 2127, 2174, 2222, 2271, 2321, 2373, 2425,
			2479, 2533, 2589, 2646, 2705, 2765, 2826, 2888,
			2952, 3017, 3083, 3151, 3221, 3292, 3365, 3439,
			3515, 3593, 3672, 3753, 3836, 3921, 4007, 4096};

const float bendltbl[64] = {
			(float)1.0,						(float)1.0009029427989777,
			(float)1.0018067009036538,		(float)1.0027112750502025,
			(float)1.0036166659754628,		(float)1.0045228744169397,
			(float)1.0054299011128027,		(float)1.0063377468018895,
			(float)1.0072464122237039,		(float)1.0081558981184175,
			(float)1.0090662052268706,		(float)1.009977334290572,
			(float)1.0108892860517005,		(float)1.0118020612531047,
			(float)1.0127156606383041,		(float)1.0136300849514894,
			(float)1.0145453349375237,		(float)1.015461411341942,
			(float)1.0163783149109531,		(float)1.0172960463914391,
			(float)1.0182146065309567,		(float)1.0191339960777379,
			(float)1.0200542157806898,		(float)1.0209752663893958,
			(float)1.0218971486541166,		(float)1.0228198633257899,
			(float)1.0237434111560313,		(float)1.0246677928971357,
			(float)1.0255930093020766,		(float)1.0265190611245079,
			(float)1.0274459491187637,		(float)1.0283736740398595,
			(float)1.0293022366434921,		(float)1.030231637686041,
			(float)1.0311618779245688,		(float)1.0320929581168212,
			(float)1.0330248790212284,		(float)1.0339576413969056,
			(float)1.034891246003653,		(float)1.0358256936019572,
			(float)1.0367609849529913,		(float)1.0376971208186156,
			(float)1.0386341019613787,		(float)1.0395719291445176,
			(float)1.0405106031319582,		(float)1.0414501246883161,
			(float)1.042390494578898,		(float)1.0433317135697009,
			(float)1.0442737824274138,		(float)1.0452167019194181,
			(float)1.0461604728137874,		(float)1.0471050958792898,
			(float)1.048050571885387,		(float)1.0489969016022356,
			(float)1.0499440858006872,		(float)1.0508921252522903,
			(float)1.0518410207292894,		(float)1.0527907730046264,
			(float)1.0537413828519411,		(float)1.0546928510455722,
			(float)1.0556451783605572,		(float)1.0565983655726334,
			(float)1.057552413458239,		(float)1.0585073227945128};

const float bendhtbl[48] = {
			(float)0.25,					(float)0.26486577358982383,
			(float)0.28061551207734325,		(float)0.29730177875068026,
			(float)0.3149802624737183,		(float)0.33370996354250859,
			(float)0.35355339059327379,		(float)0.37457676921917044,
			(float)0.3968502629920499,		(float)0.42044820762685725,
			(float)0.44544935907016969,		(float)0.47193715634084676,
			(float)0.5,						(float)0.52973154717964765,
			(float)0.56123102415468651,		(float)0.59460355750136051,
			(float)0.6299605249474366,		(float)0.66741992708501718,
			(float)0.70710678118654757,		(float)0.74915353843834076,
			(float)0.79370052598409979,		(float)0.8408964152537145,
			(float)0.89089871814033927,		(float)0.94387431268169353,
			(float)1.0,						(float)1.0594630943592953,
			(float)1.122462048309373,		(float)1.189207115002721,
			(float)1.2599210498948732,		(float)1.3348398541700344,
			(float)1.4142135623730951,		(float)1.4983070768766815,
			(float)1.5874010519681994,		(float)1.681792830507429,
			(float)1.7817974362806785,		(float)1.8877486253633868,
			(float)2.0,						(float)2.1189261887185906,
			(float)2.2449240966187456,		(float)2.3784142300054421,
			(float)2.5198420997897464,		(float)2.6696797083400683,
			(float)2.8284271247461903,		(float)2.996614153753363,
			(float)3.1748021039363987,		(float)3.363585661014858,
			(float)3.5635948725613571,		(float)3.7754972507267737};

#if defined(PANPOT_REVA)
const UINT8 revacurve[] = {
			  0,  4, 10, 14, 16, 17, 18, 19, 21, 22, 23, 25, 27, 28, 30, 32,
			 35, 37, 39, 42, 44, 47, 49, 51, 54, 56, 59, 61, 64, 66, 69, 71,
			 74, 76, 79, 81, 84, 86, 89, 91, 94, 97, 99,102,104,107,109,112,
			115,117,120,122,125,127,130,132,135,137,140,142,145,147,150,152,
			155,157,159,162,164,166,169,171,173,176,178,180,182,185,186,189,
			191,193,195,197,199,201,203,205,207,209,211,213,214,216,218,220,
			222,224,225,226,228,229,230,232,233,235,237,238,239,241,241,243,
			245,246,246,248,249,249,250,251,252,252,252,253,254,254,255,255};
#endif

#if defined(VOLUME_ACURVE)
const UINT8 acurve[] = {
			  0,  1,  1,  1,  2,  2,  3,  3,  4,  4,  5,  5,  6,  6,  7,  7,
			  7,  8,  8,  9, 10, 10, 11, 11, 12, 13, 14, 14, 15, 16, 17, 18,
			 19, 20, 21, 22, 23, 24, 26, 27, 28, 29, 31, 32, 33, 35, 36, 38,
			 39, 41, 42, 44, 46, 47, 49, 51, 52, 54, 56, 58, 60, 62, 64, 66,
			 68, 70, 72, 74, 77, 79, 81, 83, 85, 88, 90, 93, 95, 98,100,102,
			105,108,110,113,116,119,121,124,127,130,133,136,138,141,145,148,
			150,154,157,160,163,167,170,173,176,180,183,186,189,193,196,199,
			203,206,210,213,217,220,224,227,231,234,238,242,245,249,253,255};
#endif

